from Case.python_ui.Common.basepage import Basepage
import pytest, time
from Case.python_ui.Test_data.login_data import Logindata
from selenium import webdriver
from Case.python_ui.PageLocate.user_product_waf_locator import ProductWafLocator
from Case.python_ui.PageLocate.admin_content_management_system_locator import AdminCmsLocator
from selenium.common.exceptions import NoSuchElementException


class AdminContentManagementSystemModule(Basepage):

    # 判断是否包含元素
    def check_contain_str(self, string, except_string):
        if except_string in string:
            assert True
        else:
            assert False, '实际值:' + string + '期望值:' + except_string

    # 校验某个属性值是否符合预期
    def check_attribute(self, real_result, except_result):
        if real_result == except_result:
            assert True
        else:
            assert False, '实际值:' + real_result + '期望值:' + except_result

    # 元素是否存在
    def element_is_exist(self, locate):
        doc = '判断元素是否存在'
        try:
            self.get_element(locate, doc)
        except NoSuchElementException as e:
            return False
        else:
            return True

    def get_category_name_to_click(self, category_name):
        doc = '获取category名称然后点击'
        category_list = self.get_elements(AdminCmsLocator.new_page_category_list, doc)
        print("@@@@@@@@@@@@@", category_list)
        time.sleep(2)
        for category in category_list:
            if category.text == category_name:
                category.click()
        time.sleep(2)

    # 获取到Layout Template复选框名称然后点击
    def get_box_name_to_click(self, template_name):
        doc = '获取到复选框名称然后点击'
        template_list = self.get_elements(AdminCmsLocator.new_page_layout_template_list, doc)
        for template in template_list:
            if template.text == template_name:
                template.click()
        time.sleep(2)

    # 进入Pages界面
    def enter_cms_pages(self):
        time.sleep(2)
        doc = "进入Pages界面"
        for i in range(3):
            try:
                eles = self.get_elements(AdminCmsLocator.default_page_expanded, doc)
                for ele in eles:
                    ele.click()
                    time.sleep(1)
                self.wait_elevisble(AdminCmsLocator.content_management_system_tab, doc)
                self.click_element(AdminCmsLocator.content_management_system_tab, doc)
                self.wait_elevisble(AdminCmsLocator.cms_pages_title, doc)
                self.click_element(AdminCmsLocator.cms_pages_title, doc)
                break
            except:
                self.refresh_page()
                continue
        time.sleep(5)
        self.wait_elevisble(AdminCmsLocator.cms_pages_page,doc)

    # 打开New Pages弹框界面
    def open_new_pages(self):
        doc = "打开New Pages弹框界面"
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_btn,doc)
        self.wait_elevisble(AdminCmsLocator.cms_new_page_page,doc)
        time.sleep(2)
        # 检测是否存在new page页面标题
        self.check_attribute(self.get_element(AdminCmsLocator.new_page_title,doc).text,'New Page')

    # 输入页面名称、页面类别和URL等必填参数
    def input_required_parameters_new_pages(self):
        doc = "输入页面名称、页面类别和URL等必填参数面"
        self.send_keys(AdminCmsLocator.new_page_pagename_input, 'pagetest', doc)
        self.send_keys(AdminCmsLocator.new_page_dsc_input, 'abc11', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.new_page_category_input,doc)
        time.sleep(2)
        self.get_category_name_to_click('Homepage')
        self.send_keys(AdminCmsLocator.new_page_page_title_input, 'abcq', doc)
        self.send_keys(AdminCmsLocator.new_page_pageurl_input, '1111', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.new_page_layout_template_input,doc)
        time.sleep(2)
        self.get_box_name_to_click('Blank')
        # 点击save保持参数
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_save_btn,doc)
        time.sleep(2)

    # 检测New Page保存的页面数据
    def check_new_page_data(self):
        doc = "检测New Page保存的页面数据"
        self.wait_elevisble(AdminCmsLocator.cms_new_page_save_page,doc)
        time.sleep(2)
        self.save_screen(doc)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_page_header_title, doc).text, 'Please move into header component')
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_page_layout_title, doc).text, 'Please move into layout component')
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_page_footer_title, doc).text, 'Please move into footer component')

    # 返回pages首页
    def cancel_pages_page(self):
        time.sleep(2)
        doc = "返回pages首页"
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_cancel_btn, doc)
        time.sleep(2)
        self.save_screen(doc)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_cancel_sure_btn, doc)
        time.sleep(5)
        self.wait_elevisble(AdminCmsLocator.cms_pages_card_menu, doc)
        self.save_screen(doc)

    # 删除new page卡片数据
    def delete_new_page_data(self):
        doc = "删除new page卡片数据"
        time.sleep(2)
        self.move_mouse_to_element(AdminCmsLocator.cms_pages_card_menu)
        time.sleep(1)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_card_delete_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_page_card_delete_sure_dsc, doc).text, 'Are you sure delete this page?')
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_card_delete_sure_btn, doc)
        self.save_screen(doc)

    # 检测查看页面导航栏
    def check_new_page_navigation_bar(self):
        doc = "检测查看页面导航栏"
        self.wait_elevisble(AdminCmsLocator.cms_new_page_save_page, doc)
        time.sleep(2)
        self.save_screen(doc)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_page_name_title, doc).text, 'pagetest')
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_page_preview_btn, doc).text, 'Preview')

    # 检测查看页面功能栏
    def check_new_page_function_bar(self):
        doc = "检测查看页面功能栏"
        self.wait_elevisble(AdminCmsLocator.cms_new_page_save_page, doc)
        time.sleep(2)
        self.save_screen(doc)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_page_func_layout_title, doc).text, 'Layout')
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_pagefunc_func_component_title, doc).text, 'Component')
        # 点击Design按钮进入Design区
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_func_design_btn, doc)
        self.wait_elevisble(AdminCmsLocator.cms_new_pagefunc_func_component_customize_title, doc)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_pagefunc_func_component_customize_title, doc).text, 'Component customize')
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_pagefunc_func_component_customize_dsc, doc).text,'Click on a component to start editing. You could also double click on the layers')
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_pagefunc_func_layers_title, doc).text, 'Layers')
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_pagefunc_func_layers_rootDom_title, doc).text,'RootDom')

    # 检测复制new page卡片数据
    def check_enter_copy_new_page_data(self):
        doc = "检测复制new page卡片数据"
        time.sleep(2)
        self.move_mouse_to_element(AdminCmsLocator.cms_pages_card_menu)
        time.sleep(1)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_card_copy_btn, doc)
        time.sleep(2)
        self.save_screen(doc)
        self.check_attribute(self.get_element(AdminCmsLocator.new_page_pagename_input, doc).get_attribute("value"), 'pagetest-copy')
        self.move_mouse_to_click_element(AdminCmsLocator.cms_edit_new_page_cancel_btn, doc)

    # 检测设置new page卡片数据
    def check_enter_setting_new_page_data(self):
        doc = "检测设置new page卡片数据"
        time.sleep(2)
        self.move_mouse_to_element(AdminCmsLocator.cms_pages_card_menu)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_card_setting_btn, doc)
        time.sleep(2)
        self.save_screen(doc)
        self.check_attribute(self.get_element(AdminCmsLocator.new_page_pagename_input, doc).get_attribute("value"), 'pagetest')
        self.move_mouse_to_click_element(AdminCmsLocator.cms_edit_new_page_cancel_btn, doc)

    # 检测publish new page卡片数据
    def check_enter_publish_new_page_data(self):
        doc = "检测publish new page卡片数据"
        time.sleep(2)
        self.move_mouse_to_element(AdminCmsLocator.cms_pages_card_menu)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_card_publish_btn, doc)
        time.sleep(2)
        self.save_screen(doc)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_page_card_published_title, doc).text, 'Published')

    # 检测unpublish new page卡片数据
    def check_enter_unpublish_new_page_data(self):
        doc = "检测unpublish new page卡片数据"
        time.sleep(2)
        self.move_mouse_to_element(AdminCmsLocator.cms_new_page_card_published_menu_btn)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_card_published_Unpublish_btn, doc)
        time.sleep(2)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_new_page_card_unpublish_sure_dsc, doc).text, 'Are you sure unpublish this page?')
        self.save_screen(doc)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_new_page_card_unpublish_sure_btn, doc)
        time.sleep(2)

    # pages页新增Category
    def add_category_func(self):
        doc = "pages页新增Category"
        time.sleep(2)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_page_add_categroy_btn, doc)
        time.sleep(1)

    # 检测pages页新增Category页面数据
    def check_add_category_page_data(self):
        doc = "检测pages页新增Category页面数据"
        time.sleep(1)
        categroy_default_name_title = self.get_element(AdminCmsLocator.cms_page_add_categroy_default_name_title, doc).text
        categroy_default_name = self.get_element(AdminCmsLocator.cms_page_add_categroy_default_name, doc).get_attribute("value")
        self.check_attribute(categroy_default_name_title, categroy_default_name)
        # 点击新增Category页面‘+’按钮
        self.move_mouse_to_click_element(AdminCmsLocator.cms_page_add_categroy_info_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.new_page_title, doc).text, 'New Page')
        self.move_mouse_to_click_element(AdminCmsLocator.cms_edit_new_page_cancel_btn, doc)

    # pages页删除新增Category
    def delete_category_func(self):
        doc = "pages页新增Category"
        time.sleep(2)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_page_delete_categroy_btn, doc)
        time.sleep(1)

    # pages页输入有效字段搜索数据
    def check_page_search_valid_filter_func(self):
        doc = "pages页输入有效字段搜索数据"
        time.sleep(2)
        self.send_keys(AdminCmsLocator.cms_page_search_input, 'pagetest', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_page_search_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_page_search_detail_title, doc).text, 'Homepage')
        time.sleep(1)
        self.keyboard_event(AdminCmsLocator.cms_page_search_input, doc)

    # pages页输入无效字段搜索数据
    def check_page_search_invalid_filter_func(self):
        doc = "pages页输入无效字段搜索数据"
        time.sleep(2)
        self.send_keys(AdminCmsLocator.cms_page_search_input, 'pagetest1111', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_page_search_btn, doc)
        time.sleep(1)
        invalid_dsc = self.get_element(AdminCmsLocator.cms_page_search_no_data_dsc, doc).text
        new_invalid_dsc = invalid_dsc.replace("\n", ' ', 1).strip()
        self.check_attribute(new_invalid_dsc, 'Sorry, we couldn&apos;t find anything matching. Please remove or try other filters.')
        time.sleep(1)

    # 进入Images界面
    def enter_cms_images(self):
        time.sleep(2)
        doc = "进入Pages界面"
        for i in range(3):
            try:
                eles = self.get_elements(AdminCmsLocator.default_page_expanded, doc)
                for ele in eles:
                    ele.click()
                    time.sleep(1)
                self.wait_elevisble(AdminCmsLocator.content_management_system_tab, doc)
                self.click_element(AdminCmsLocator.content_management_system_tab, doc)
                self.wait_elevisble(AdminCmsLocator.cms_materials_title, doc)
                self.click_element(AdminCmsLocator.cms_materials_title, doc)
                break
            except:
                self.refresh_page()
                continue
        time.sleep(5)
        self.wait_elevisble(AdminCmsLocator.cms_images_page, doc)

    # 检测Images页卡片编辑图像信息
    def check_images_edit_image_data(self):
        doc = "检测Images页卡片编辑图像信息"
        time.sleep(1)
        self.move_mouse_to_element(AdminCmsLocator.cms_images_card_menu_btn)
        self.save_screen(doc)
        time.sleep(1)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_image_card_setting_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_image_card_edit_title, doc).text, 'Setting')
        self.move_mouse_to_click_element(AdminCmsLocator.cms_image_card_edit_save_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_image_card_edit_save_success_tips, doc).text, 'Modified successfully.')

    # Images页新增Category
    def images_add_category_func(self):
        doc = "Images页新增Category"
        time.sleep(2)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_image_add_categroy_btn, doc)
        time.sleep(1)

    # 检测Images页新增Category页面数据
    def check_add_category_image_data(self):
        doc = "检测Images页新增Category页面数据"
        time.sleep(1)
        categroy_default_name_title = self.get_element(AdminCmsLocator.cms_image_add_categroy_default_name_title, doc).text
        categroy_default_name = self.get_element(AdminCmsLocator.cms_image_add_categroy_default_name, doc).get_attribute("value")
        self.check_attribute(categroy_default_name_title, categroy_default_name)
        # 点击新增Category页面‘+’按钮
        self.move_mouse_to_click_element(AdminCmsLocator.cms_image_add_categroy_info_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.new_images_title, doc).text, 'New Images')
        self.move_mouse_to_click_element(AdminCmsLocator.cms_edit_new_image_cancel_btn, doc)

    # Images页删除新增Category
    def image_delete_category_func(self):
        doc = "Images页删除新增Category"
        time.sleep(2)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_image_delete_categroy_btn, doc)
        time.sleep(1)

    # Images页输入有效字段搜索数据
    def check_image_search_valid_filter_func(self):
        doc = "Images页输入有效字段搜索数据"
        time.sleep(2)
        self.send_keys(AdminCmsLocator.cms_images_search_input, 'my', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_images_search_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_images_search_detail_items, doc).text, 'Total 1 items')
        time.sleep(1)
        self.keyboard_event(AdminCmsLocator.cms_images_search_input, doc)

    # Images页输入无效字段搜索数据
    def check_image_search_invalid_filter_func(self):
        doc = "Images页输入无效字段搜索数据"
        time.sleep(2)
        self.send_keys(AdminCmsLocator.cms_images_search_input, 'my111', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_images_search_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_images_search_no_data_dsc, doc).text, 'Total 0 items')
        time.sleep(1)
        self.keyboard_event(AdminCmsLocator.cms_images_search_input, doc)

    # 进入Videos界面
    def enter_cms_Videos(self):
        time.sleep(2)
        doc = "进入Videos界面"
        # 进入Videos页
        self.move_mouse_to_click_element(AdminCmsLocator.cms_videos_page_tittle, doc)
        time.sleep(1)

    # 检测Videos页卡片编辑视频信息
    def check_videos_edit_video_data(self):
        doc = "检测Videos页卡片编辑视频信息"
        time.sleep(2)
        self.move_mouse_to_element(AdminCmsLocator.cms_video_card_menu_btn)
        time.sleep(1)
        self.save_screen(doc)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_video_card_setting_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_video_card_edit_title, doc).text, 'Setting')
        self.move_mouse_to_click_element(AdminCmsLocator.cms_video_card_edit_save_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_video_card_edit_save_success_tips, doc).text, 'Modified successfully.')

    # Videos页新增Category
    def videos_add_category_func(self):
        doc = "Videos页新增Category"
        time.sleep(2)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_video_add_categroy_btn, doc)
        time.sleep(1)

    # 检测Videos页新增Category页面数据
    def check_add_category_video_data(self):
        doc = "检测Videos页新增Category页面数据"
        time.sleep(1)
        categroy_default_name_title = self.get_element(AdminCmsLocator.cms_video_add_categroy_default_name_title, doc).text
        categroy_default_name = self.get_element(AdminCmsLocator.cms_video_add_categroy_default_name, doc).get_attribute("value")
        self.check_attribute(categroy_default_name_title, categroy_default_name)
        # 点击新增Category页面‘+’按钮
        self.move_mouse_to_click_element(AdminCmsLocator.cms_video_add_categroy_info_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.new_videos_title, doc).text, 'New Videos')
        self.move_mouse_to_click_element(AdminCmsLocator.cms_edit_new_video_cancel_btn, doc)

    # Videos页删除新增Category
    def video_delete_category_func(self):
        doc = "Videos页删除新增Category"
        time.sleep(2)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_video_delete_categroy_btn, doc)
        time.sleep(1)

    # Videos页输入有效字段搜索数据
    def check_video_search_valid_filter_func(self):
        doc = "Videos页输入有效字段搜索数据"
        time.sleep(2)
        self.send_keys(AdminCmsLocator.cms_video_search_input, 'v1', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_video_search_btn, doc)
        time.sleep(2)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_videos_search_detail_items, doc).text, 'Total 1 items')
        time.sleep(1)
        self.keyboard_event(AdminCmsLocator.cms_video_search_input, doc)

    # Videos页输入无效字段搜索数据
    def check_video_search_invalid_filter_func(self):
        doc = "Videos页输入无效字段搜索数据"
        time.sleep(2)
        self.send_keys(AdminCmsLocator.cms_video_search_input, 'v1111', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.cms_video_search_btn, doc)
        time.sleep(1)
        self.check_attribute(self.get_element(AdminCmsLocator.cms_videos_search_no_data_dsc, doc).text, 'Total 0 items')
        time.sleep(1)
        self.keyboard_event(AdminCmsLocator.cms_video_search_input, doc)

    # 进入admin端的Bill-Amount Adjustment首页
    def enter_amount_adjustment_page(self):
        doc='进入admin端的Bill-Amount Adjustment首页'
        time.sleep(5)
        for i in range(3):
            try:
                self.scroll_bar_operation(AdminCmsLocator.amount_adjustment_tab)
                self.wait_elevisble(AdminCmsLocator.amount_adjustment_tab, doc)
                self.move_mouse_to_click_element(AdminCmsLocator.amount_adjustment_tab, doc)
                break
            except:
                self.refresh_page()
                time.sleep(5)
                continue
        self.wait_elevisble(AdminCmsLocator.page_total, doc)

    # Bill-Amount Adjustment页面的Operation ID类型的搜索功能检验
    def check_operation_id_search_func(self):
        doc = 'Bill-Amount Adjustment页面的Operation ID类型的搜索功能检验'
        time.sleep(3)
        self.move_mouse_to_click_element(AdminCmsLocator.batch_operation_tittle_btn, doc)
        time.sleep(3)
        # 检测模糊搜索功能
        self.send_keys(AdminCmsLocator.batch_operation_search_input, '0000', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.batch_operation_search_btn, doc)
        self.wait_elevisble(AdminCmsLocator.batch_operation_fuzzy_search_result, doc)
        self.wait_elevisble(AdminCmsLocator.batch_operation_fuzzy_search_result, doc)
        self.check_attribute(self.get_element(AdminCmsLocator.batch_operation_fuzzy_search_result, doc).text, 'No Data')
        # 检测精确搜索功能
        self.keyboard_event(AdminCmsLocator.batch_operation_search_input, doc)
        self.send_keys(AdminCmsLocator.batch_operation_search_input, '0000008', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.batch_operation_search_btn, doc)
        self.wait_elevisble(AdminCmsLocator.batch_operation_exact_search_result_id, doc)
        self.check_attribute(self.get_element(AdminCmsLocator.batch_operation_exact_search_result_id, doc).text, '0000008')
        self.check_attribute(self.get_element(AdminCmsLocator.batch_operation_exact_search_result_operator, doc).text, 'lwm528675013@163.com')

    # Bill-Amount Adjustment页面的Operator类型的搜索功能检验
    def check_operator_search_func(self):
        doc = 'Bill-Amount Adjustment页面的Operator类型的搜索功能检验'
        time.sleep(3)
        # 切换搜索类型字段进行模糊搜索
        self.move_mouse_to_click_element(AdminCmsLocator.batch_operation_search_type_btn, doc)
        self.move_mouse_to_click_element(AdminCmsLocator.batch_operation_search_operator_btn, doc)
        self.keyboard_event(AdminCmsLocator.batch_operation_search_input, doc)
        self.send_keys(AdminCmsLocator.batch_operation_search_input, 'lwm52', doc)
        self.move_mouse_to_click_element(AdminCmsLocator.batch_operation_search_btn, doc)
        self.wait_elevisble(AdminCmsLocator.batch_operation_operator_fuzzy_search_result, doc)
        self.check_attribute(self.get_element(AdminCmsLocator.batch_operation_operator_fuzzy_search_result, doc).text, 'lwm528675013@163.com')

    # 进入admin端的Promo Management-Voucher Template首页
    def enter_voucher_template_page(self):
        doc = '进入admin端的Promo Management-Voucher Template首页'
        time.sleep(3)
        for i in range(3):
            try:
                eles = self.get_elements(AdminCmsLocator.default_page_expanded, doc)
                for ele in eles:
                    ele.click()
                    time.sleep(1)
                self.wait_elevisble(AdminCmsLocator.promo_management_tab, doc)
                self.move_mouse_to_click_element(AdminCmsLocator.promo_management_tab, doc)
                self.wait_elevisble(AdminCmsLocator.voucher_template_tab, doc)
                self.move_mouse_to_click_element(AdminCmsLocator.voucher_template_tab, doc)
                break
            except:
                self.refresh_page()
                time.sleep(5)
                continue
        self.wait_elevisble(AdminCmsLocator.jump_page, doc)

    # Voucher Template页面的筛选功能检验
    def check_voucher_template_filter_func(self):
        doc = 'Voucher Template页面的筛选功能检验'
        time.sleep(3)
        # 筛选Enabled类型的数据
        self.move_mouse_to_click_element(AdminCmsLocator.status_filter_btn, doc)
        self.wait_elevisble(AdminCmsLocator.status_filter_enable_btn, doc)
        self.move_mouse_to_click_element(AdminCmsLocator.status_filter_enable_btn, doc)
        self.move_mouse_to_click_element(AdminCmsLocator.status_filter_ok_btn, doc)
        time.sleep(3)
        self.wait_elevisble(AdminCmsLocator.status_filter_enable_result, doc)
        self.check_attribute(self.get_element(AdminCmsLocator.status_filter_enable_result, doc).text, 'Enabled')
        # 筛选Disabled类型的数据
        self.move_mouse_to_click_element(AdminCmsLocator.status_filter_btn, doc)
        time.sleep(1)
        self.move_mouse_to_click_element(AdminCmsLocator.status_filter_reset_btn, doc)
        time.sleep(1)
        self.wait_elevisble(AdminCmsLocator.status_filter_disabled_btn, doc)
        self.move_mouse_to_click_element(AdminCmsLocator.status_filter_disabled_btn, doc)
        self.move_mouse_to_click_element(AdminCmsLocator.status_filter_ok_btn, doc)
        time.sleep(3)
        self.wait_elevisble(AdminCmsLocator.status_filter_disabled_result, doc)
        self.check_attribute(self.get_element(AdminCmsLocator.status_filter_disabled_result, doc).text, 'Disabled')





